package com.zxp.utils.fileUtils;

import java.io.File;

public class FolderCreator {

    /**
     * Create a folder
     *
     * @param folderName The name of the folder to create
     * @return true if successfully created or the folder already exists, false if creation fails
     */
    public static boolean createFolder(String folderName) {
        File folder = new File(folderName);

        // If the folder already exists, return true
        if (folder.exists() && folder.isDirectory()) {
//            System.out.println("Folder '" + folderName + "' already exists.");
            return true;
        }

        // Try to create the folder
        boolean created = folder.mkdirs();

//        if (created) {
//            System.out.println("Folder '" + folderName + "' created successfully.");
//        } else {
//            System.out.println("Failed to create folder '" + folderName + "'.");
//        }

        return created;
    }

    public static void main(String[] args) {
        // Example usage
        String folderName = "exampleFolder";
        createFolder(folderName);
    }
}
